/**
  ******************************************************************************
  * @file    main.c
  * @author  MCD Application Team
  * @version V1.2.1
  * @date    30-September-2014
  * @brief   Main program body
  ******************************************************************************
  * @attention
  *
  * <h2><center>&copy; COPYRIGHT 2014 STMicroelectronics</center></h2>
  *
  * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
  * You may not use this file except in compliance with the License.
  * You may obtain a copy of the License at:
  *
  *        http://www.st.com/software_license_agreement_liberty_v2
  *
  * Unless required by applicable law or agreed to in writing, software 
  * distributed under the License is distributed on an "AS IS" BASIS, 
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  *
  ******************************************************************************
  */

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __MAIN_H
#define __MAIN_H

/* Includes ------------------------------------------------------------------*/
#include "stm8l10x.h"
#include "gpio_input.h"

#define RUN_TIME (uint16_t)8000 /*mS*/
#define IDLE_TIME (uint16_t)4000 /*mS*/

#define LED_GPIO_PORT GPIOC

#define PWM_OUTPUT_EN()  (TIM2->CCER1 |= 0x01 )
#define PWM_OUTPUT_DIS() (TIM2->CCER1 &= ~0x01 )//;TIM2->EGR |= TIM2_EventSource_CC1


typedef enum
{
  State_Idle = 0,
  State_Run,
  State_Sleep,
}State_t;



#endif /*end of main.h*/
